//
//  AddEventViewController.m
//  HaiGoumerMerchant
//
//  Created by apple on 17/1/18.
//  Copyright © 2017年 com.zaoguankeji.www. All rights reserved.
//

#import "AddEventViewController.h"

@interface AddEventViewController ()<JGPickerDelegate>
@property (nonatomic,strong)JGPicker  *Startpicker;
@property (nonatomic,strong)JGPicker  *Endpicker;
@property (weak, nonatomic) IBOutlet UIButton *eventStartBtn;
@property (weak, nonatomic) IBOutlet UILabel *eventStartLab;
@property (weak, nonatomic) IBOutlet UIButton *eventEndBtn;
@property (weak, nonatomic) IBOutlet UILabel *eventEEndLab;
@property (weak, nonatomic) IBOutlet UITextField *eventNameTF;
@property (weak, nonatomic) IBOutlet UITextField *eventNumTF;
@property (weak, nonatomic) IBOutlet UITextField *eventDisCountTF;

@end

@implementation AddEventViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"创建活动";
     _Startpicker = [[JGPicker alloc] initWithFrame:self.view.frame type:UIDatePickerModeDateAndTime andDelegate:self];
     _Endpicker = [[JGPicker alloc] initWithFrame:self.view.frame type:UIDatePickerModeDateAndTime andDelegate:self];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)eventStartBtnAction:(id)sender {
    [_Startpicker show];

}

#pragma JGPickerDelegate
- (void) determinSelectedJGPicker:(JGPicker *)pick :(NSDate *)date
{
    if (pick == self.Startpicker) {
         self.eventStartLab.text = [pick stringFromDate:date];
    } else {
         self.eventEEndLab.text = [pick stringFromDate:date];
    }
   
    
    NSLog(@"最终选择了:%@",[pick stringFromDate:date]);
}
- (IBAction)eventEndBtnAction:(id)sender {
      [_Endpicker show];
}
@end
